package sms.ui.xuesheng;

import sms.dao.XueShengDao;
import sms.entry.XueSheng;
import sms.ui.XueShengGuanLi;

import java.util.Scanner;

public class XueShengTianJia {
    private static XueShengDao xueShengDao = new XueShengDao();
    /*
    * 保存信息
    * */
    public static void show(){
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入学生学号：");
        int xuehao = sc.nextInt();
        System.out.println("请输入学生姓名：");
        String name = sc.next();
        System.out.println("请输入学生性别：");
        String sex = sc.next();
        System.out.println("请输入学生出生年月：");
        String brithday = sc.next();
        XueSheng xueSheng = new XueSheng(xuehao, name, sex, brithday);
        //调用XueShengDao 的方法添加保存
        xueShengDao.save(xueSheng);
        System.out.println("添加成功，已保存！");
        //返回学生信息主页面
        XueShengGuanLi.show();



    }
}
